package com.netflexitysolutions.amazonws.s3;

import com.amazonaws.s3.doc._2006_03_01.GetObjectResult;
import com.netflexitysolutions.amazonws.s3.internal.utils.S3Utils;
import java.util.HashMap;
import java.util.Map;

public class S3GetObjectResponse {

    private S3ServerResponseStatus status;
    private S3Object object;

    public S3GetObjectResponse(GetObjectResult result) {
//Real GetObjectResponse differ from xsd :(
//        status = new S3ServerResponseStatus()
        Map<String, String> metadata = new HashMap<String, String>();
        S3Utils.fillMetadata(result.getMetadata(), metadata);
        object = new S3Object(null, result.getData(), metadata);
    }

    public S3ServerResponseStatus getStatus() {
        return status;
    }

    public S3Object getObject() {
        return object;
    }
    
}
